Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All-Ones netmask is not needed for ACLs or flow logging #4440

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

milan-zededa
Copy link
Contributor

@milan-zededa milan-zededa commented Nov 15, 2024

The DHCP server deployed by EVE for Local Network Instances assigns IP addresses to applications with a /32 netmask (all-ones) and uses the Classless Static Route Option (RFC 3442) to configure static routes for the NI subnet. This setup enforces routing even for east-west (app-to-app) traffic, which would otherwise only be forwarded if the actual NI subnet mask (e.g., /24) was used.

This approach was historically implemented to prevent east-west traffic from bypassing ACLs and to ensure that connection tracking (conntrack) entries were created for flow logging purposes. However, it became unnecessary after we enabled the net.bridge.bridge-nf-call-ip(6)tables option, which ensures that even traffic forwarded by a bridge within EVE passes through iptables filtering and has conntrack entries created.

Using a /32 netmask now offers no added value and has some drawbacks. First, applications may use DHCP servers with the Classless Route option disabled, resulting in obtaining all-ones netmask with no reachable destinations due to missing connected routes. Second, enforcing routing adds extra packet processing steps for traffic that could be directly forwarded between applications, increasing overhead and reducing network performance.

We previously added an option to disable the all-ones netmask (while still keeping it enabled by default), but this has increased code complexity since it requires two distinct routing configurations to manage (and test). I propose removing the all-ones netmask configuration altogether to simplify the code and reduce packet processing overhead. While some may consider this a breaking change, I believe the change in the netmask should not impact applications as long as IP addresses are preserved and the overall routing/bridging functionality remains consistent across EVE upgrades (the set of reachable destinations does not change).

This PR is part of a series of network performance optimizations coming into EVE, see documentation (will be submitted in a separate PR)

@milan-zededa
Copy link
Contributor Author

milan-zededa commented Nov 15, 2024

@eriknordmark Do you remember what was the use-case of the /32 netmask given to applications? It does not seem to be needed for ACLs or flow logging.
Could we remove this or would change in netmask be considered a breaking change for some apps (the application IP and the set of reachable destinations will remain the same)?

The DHCP server deployed by EVE for Local Network Instances assigns
IP addresses to applications with a /32 netmask (all-ones) and uses
the Classless Static Route Option (RFC 3442) to configure static routes
for the NI subnet. This setup enforces routing even for east-west
(app-to-app) traffic, which would otherwise only be forwarded if
the actual NI subnet mask (e.g., /24) were used.

This approach was historically implemented to prevent east-west traffic
from bypassing ACLs and to ensure that connection tracking (conntrack)
entries were created for flow logging purposes. However, it became
unnecessary after we enabled the "net.bridge.bridge-nf-call-iptables"
option, which ensures that even traffic forwarded by a bridge within
EVE passes through iptables filtering and has conntrack entries created.

Using a /32 netmask now offers no added value and has some drawbacks.
First, applications may use DHCP servers with the Classless Route option
disabled, resulting in obtaining all-ones netmask with no reachable
destinations due to missing connected routes. Second, enforcing routing
adds extra packet processing steps for traffic that could be directly
forwarded between applications, increasing overhead and reducing network
performance.

We previously added an option to disable the all-ones netmask (while still
keeping it enabled by default), but this has increased code complexity
since it requires two distinct routing configurations to manage (and test).
I propose removing the all-ones netmask configuration altogether to simplify
the code and reduce packet processing overhead. While some may consider this
a breaking change, I believe the change in the netmask should not impact
applications as long as IP addresses are preserved and the overall
routing/bridging functionality remains consistent across EVE upgrades
(the set of reachable destinations does not change).

Signed-off-by: Milan Lenco <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant